export const getMeunsTree = (data: any[], parentId: string = '0') => {
  if (data.length === 0) {
    return
  }
  const newData = data.filter(item => item.parentId !== parentId)
  const res = []
  data.forEach(item => {
    const id = item._id.toString()
    if (item.parentId === parentId) {
      res.push({
        ...item.toJSON(),
        children: getMeunsTree(newData, id)
      })
    }
  })
  return res
}